#include "Observable.h"
#include <iostream>


Observable::Observable(void){}

Observable::~Observable(void){}

void Observable::attach(Observer *myObserver)
{
  myObs.push_back(myObserver);
}

void Observable::detach(Observer *myObserver)
{
  for(int i = 0; i < myObs.size(); i++)
    {
      if(myObs[i] == myObserver)
	{
	  myObs.erase(myObs.begin() + i);
	  break;
	}
    }
}

void Observable::notifyObs()
{
  for(int i = 0; i < myObs.size(); i++) {
    myObs[i]->update(this);
  }
}

string* Observable::getState()
{
  string *state = new string;

  return 0l;
}
